home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / amos / amoslist.lzh / AMOSLIST / 000374_amos-request@svcs1.digex.net_Thu Sep 28 10:04:25 1995.msg < prev    next >
Internet Message Format  |  1995-10-02  |  3KB

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224]) by mail1.access.digex.net (8.6.12/8.6.12) with ESMTP id KAA01145;  for <mcox@access.digex.net> ; Thu, 28 Sep 1995 10:04:24 -0400
  2. Received: (from daemon@localhost) by svcs1.digex.net (8.6.12/8.6.12) id FAA11329 for amos-out; Thu, 28 Sep 1995 05:35:01 -0400
  3. Received: from mail1.access.digex.net (mail1.access.digex.net [205.197.247.2]) by svcs1.digex.net (8.6.12/8.6.12) with ESMTP id FAA11326 for <amos-list@svcs1.digex.net>; Thu, 28 Sep 1995 05:34:59 -0400
  4. Received: from relay-3.mail.demon.net (post.demon.co.uk [158.152.1.72]) by mail1.access.digex.net (8.6.12/8.6.12) with SMTP id FAA11532;  for <amos-list@access.digex.net> ; Thu, 28 Sep 1995 05:34:56 -0400
  5. Received: from westmead.demon.co.uk by relay-3.mail.demon.net id aa19133;
  6.           28 Sep 95 10:34 +0100
  7. From: Mark Carter <Mark@westmead.demon.co.uk>
  8. Organization:  None Whatsoever
  9. To: amos-list@access.digex.net
  10. Date:          Thu, 28 Sep 1995 10:22:28 +0000
  11. Subject:       Re: Help me!
  12. Priority: normal
  13. X-mailer: Pegasus Mail/Windows (v1.22)
  14. Message-ID: <9509281034.aa19133@relay-3.mail.demon.net>
  15. Status: RO
  16. X-Status: 
  17.  
  18. > M> Why do you use *256 and then /256?? Does it give extra speed??
  19. > 256=2^8, numerical work involving powers of 2 are optimised (with the
  20. > pro compiler) by shifting the variable in memory however many bits. If
  21. > you don't understand this, then all you need to know is that it's much
  22. > faster and can be used instead of very slow floating point numbers.
  23.  
  24. I think its time to draw up an anlaogy to explain this:
  25.  
  26. If I asked anyone to calculate "10 times 23" or "100 times 47" etc in 
  27. their heads they would give me the result in pretty quick time. 
  28. However, if I asked the same person to calculate "7 times 23" or "83 
  29. time 47" etc it would take them much much longer (maybe 10 times as 
  30. long....).
  31.  
  32. You see here's what happens when we calculate 10*47 in our heads:
  33.  
  34. We recognise 10 as a power of 10 (10=10^1).
  35. We see there is ONE zero in this power.
  36. Then we simply join the ONE zero to the right hand side of the number 
  37. we are multiplying it by. eg. 10*47=470 <- theres that new zero!
  38.  
  39. Processors operate in a similar way except thay use powers of 2 
  40. (there are 2 states: 0 and 1) instead of powers of 10 (we use 10 
  41. states: 0,1,2,3,4,5,6,7,8 and 9).
  42.  
  43. Easy, eh?
  44.  
  45.  
  46. I'm sure everyone on this list understands this anyway, but if you 
  47. come across any poor soul who cannot comprehend such trivialities 
  48. then this is a good way to explain it ;-)
  49.  
  50. Cheers,
  51.  
  52. Mark
  53.  
  54. Mark Carter
  55. e-mail: mark@westmead.demon.co.uk,   exet0007@sable.ox.ac.uk